package cn.jdbc;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class TestJDBC2 {
    public static void main(String[] args) {
        Connection con= JDBCUnit.connection();
        Statement statement=null;
        ResultSet resultSet=null;
        try {
            statement = con.createStatement();
            resultSet = statement.executeQuery("select*from acc");
            while (resultSet.next()){
                int id=resultSet.getInt("id");
                String name=resultSet.getString("name");
                Double money=resultSet.getDouble("money");
                System.out.println(id+" "+name+" "+money);
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }finally {
            JDBCUnit.close(resultSet, statement,con );
        }
    }
}
